﻿<controls:ChildWindow 
    x:Class="ibba.src.noriskbo.PageConfirmacaoEnquadramento"    
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:slc="clr-namespace:ibba.src.sl.componentes;assembly=ibba.src.sl.componentes"    
    Title="Detalhes enquadramento"
    Width="600" MaxHeight="400" FontSize="10.667"     
    Style="{StaticResource ChildWindowStyle}">

    <controls:ChildWindow.Resources>        
        <Style x:Key="WordWrapp" TargetType="TextBlock">
            <Setter Property="TextWrapping" Value="Wrap" />
        </Style>
    </controls:ChildWindow.Resources>

    <Grid x:Name="LayoutRoot" Margin="0" Background="#FFFFFFFF">
        <toolkit:BusyIndicator x:Name="activity">
            
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="auto" />
                    <RowDefinition Height="85" />
                </Grid.RowDefinitions>

                <StackPanel Grid.Row="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                    <TextBlock Text="Operações selecionadas" FontSize="12" Foreground="#FFE78E21" />

                    <sdk:DataGrid Name="grdOperacoes" 
                                  HorizontalScrollBarVisibility="Auto" 
                                  BorderThickness="1" MaxHeight="300"
                                  AutoGenerateColumns="False"
                                  VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                        <sdk:DataGrid.Columns>
                            <sdk:DataGridTextColumn Header="Operação" Width="186" Binding="{Binding CodigoContrato}" />
                            <sdk:DataGridTextColumn Header="Id SubLimite" Binding="{Binding IdSubLimite}" Visibility="Collapsed" />
                            <sdk:DataGridTextColumn Header="Descrição do sublimite atual" MinWidth="310" Binding="{Binding SubLimite}"  ElementStyle="{StaticResource WordWrapp}"/>
                        </sdk:DataGrid.Columns>
                    </sdk:DataGrid>
                    
                </StackPanel>

                <StackPanel Grid.Row="1" Name="DadosEnquadramento" Margin="0,20,0,20">
                    <TextBlock Text="Sublimite" Margin="0,10,0,0" FontSize="12" Foreground="#FFE78E21" />
                    <ComboBox x:Name="cboSublimiteDestino" 
                              HorizontalAlignment="Stretch" 
                              SelectionChanged="cboSublimiteDestino_SelectedChange"                        
                              SelectedItem="{Binding Mode=TwoWay, Path=IdSubLimite}" >
                        <ComboBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding  Path=Descricao}" TextWrapping="Wrap" Width="550" />
                                </StackPanel>
                            </DataTemplate>
                        </ComboBox.ItemTemplate>
                    </ComboBox>

                    <TextBlock Text="Justificativa" Margin="0,10,0,0" FontSize="12" Foreground="#FFE78E21" />
                    <ComboBox x:Name="cboJustificativa" 
                              HorizontalAlignment="Stretch"
                              SelectedItem="{Binding Path=Id_Justificativa, Mode=TwoWay}"
                              SelectionChanged="cboJustificativa_SelectionChanged">
                        <ComboBox.ItemTemplate >
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding  Path=Id_Justificativa}" />
                                    <TextBlock Text=". " />
                                    <TextBlock Text="{Binding  Path=Ds_Justificativa}" />
                                </StackPanel>
                            </DataTemplate>
                        </ComboBox.ItemTemplate >
                    </ComboBox>

                </StackPanel>

                <slc:ControlMenuBar x:Name="barraMenu" Grid.Row="2" VerticalAlignment="Bottom" BorderRadius="15,0,15,0" VisibilityUserPanel="Collapsed" 
                                    Background="{StaticResource BlueStrong}"/>
            </Grid>
        </toolkit:BusyIndicator>
    </Grid>
    
</controls:ChildWindow>